package com.wans.guli.auth.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpSession;

@Controller
public class WebViewController {

    @GetMapping(value = {"/", "/login.html"})
    public String loginView() {
        return "login";
    }

    @GetMapping(value = {"/register.html"})
    public String registerView() {
        return "register";
    }


    @GetMapping(value = {"/logout.html"})
    public String registerView(HttpSession  session) {

        session.removeAttribute("loginMember");
        session.invalidate();

        return "login";
    }
}
